The present invention relates to a virtual machine system and an operating method thereof, and more particularly to a technique for management of resources in virtual machine environments.
In recent years, virtualization techniques for computing machines have attracted increasing attention. By the virtualization technique, it is possible to construct plural virtual computing machines on one real computing machine, and to run plural Operating Systems (OSs) independently. While the real computing machine is termed as “Real Machine”, this virtual computing machine is referred to as “Virtual Machine (VM)”. The VM is constructed based on and controlled by a Virtual Machine Monitor (VMM), which is a software running on the real machine. While an Operating System (OS) running on the real machine is referred to a “host OS”, an OS running on the VM provided by the VMM is referred to as a “guest OS”.
Plural VMs are constructed assuming that these machines run independently on the same real machine. Since the plural VMs are completely separated from each other, it is basically necessary to prepare for a memory source for each VM.
FIG. 1 schematically shows the allocation of memory resources in a VM environment of the related art. Two VMs (VM1, VM2) run on the same real machine. The VMM performs mapping between a physical address space of a virtual memory owned by the VM and a real physical address space of a physical memory owned by the real machine using a mapping table. For example, a top address “xxx” of a kernel text section in a VM1 physical address space is mapped to an address “ADD1” in a real physical address space. In contrast, a top address “yyy” of a kernel text section in a VM2 physical address space is mapped to an address “ADD2” in the real physical address space.
In this way, the kernel text section of the VM1 and the kernel text section of the VM2 are allocated to separate areas in the real physical address space. When the guest OS running on the VM1 is the same as the guest OS running on the VM2, that is, when the VM1 and the VM2 have the same kernel text section, memory images of the kernel text section are superimposed on each other on the physical memory. In other words, when the same kernel text is loaded into plural VMs, the memory resources are not used effectively.
For this reason, a method has been proposed in which the same memory image on the physical memory is shared between the plural VMs. FIG. 2 schematically shows sharing of the memory image. In the case of an example shown in FIG. 2, an address “yyy” in the VM2 physical address space in a mapping table associated with the VM2 corresponds to an address “ADD1” in the real physical address space. As a result, when the VM2 refers to the kernel text section, the VMM accesses an area starting from the address “ADD1” of the real physical address space. That is, the kernel text section on the physical memory is shared between the VM1 and the VM2. This saves the memory resources.
A method for sharing the memory image between the VMs is known as follows. For example, plural templates for OS kernels and application programs are previously prepared for in the VMM. A user selects which template is started/executed. When the same template is used on the VMs, the memory image is shared between the VMs.
According to the technique as disclosed in patent document 1 (Japanese Unexamined Patent Document 2004-258698), sharing of the memory image is performed after the entire completion of boot of plural OSs, which includes loading of the kernel.
That is, at the timing of the operation of the plural OSs, the sharing of memory sources is performed. Thus, a dedicated application (an application of requirement for memory sharing) is prepared, and executed by each of the OSs. The dedicated application on the first OS previously registers a memory area by an entry. The user designates the entry and the second OS, and instructs the dedicated application on the second OS to perform the sharing. The dedicated application on the second OS checks whether the memory image in the designated memory area can be shared or not according to the instruction of the user. In this way, it is necessary for the user to prepare for the dedicated applications and to designate the OS and the object to be shared. Patent Document 1 does not describe the process in shutting down the OS.
According to the related technique as described above, the user is required to previously prepare for the template in the VMM or to designate the OS and object to be shared. However because in recent years viruses have increased along with the popularization of the Internet, the frequency of updating of an OS/application program has been increased. And as an OS remote install or a SAN (Storage Area Network) boot becomes popular, systems including various kinds or versions of OSs have been available. In such an environment, the intervention of the user is required for sharing of the memory image between the VMs, which may increase burden on the user or a system constructor and manager.